<template>
    <bi-form ref="form">
        <bi-form-item label="分组名称">
            <bi-input v-model="form.title" required></bi-input>
        </bi-form-item>
    </bi-form>
</template>

<script>
export default{
    data(){
        let form = {
            group_id:'',
            title:'',
        }

        form = this.$assign(form,this.item);
        return {
            form,
        }
    },
    props:{
        item:Object
    },
    methods:{
        dialogOk(){

            if (this.$refs.form.check()){
                this.$ajax({
                    url:this.$url({action:'saveGroup'}),
                    data:this.form,
                    success:()=>{
                        this.$toast('保存成功');
                        this.dialog.callback();   
                    }
               });
            }
        }
    }
}
</script>